package com.sq.universe.flowable;

import com.sq.universe.base.conf.RibbonConfig;
import com.sq.universe.flowable.conf.AppDispatcherServletConfiguration;
import org.flowable.form.spring.SpringFormEngineConfiguration;
import org.flowable.spring.boot.FlowableSecurityAutoConfiguration;
import org.flowable.spring.boot.idm.IdmEngineServicesAutoConfiguration;
import org.flowable.ui.common.security.FlowableUiSecurityAutoConfiguration;
import org.flowable.ui.modeler.conf.ApplicationConfiguration;
import com.sq.universe.flowable.conf.DatabaseAutoConfiguration;
import org.flowable.ui.modeler.conf.ModelerDatabaseConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Import;
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
import springfox.documentation.oas.annotations.EnableOpenApi;

//启用全局异常拦截器
@Import(value = {
		// 引入修改的配置
		ApplicationConfiguration.class,
		AppDispatcherServletConfiguration.class,
		// 引入 DatabaseConfiguration 表更新转换
		//DatabaseConfiguration.class,
		ModelerDatabaseConfiguration.class,
        SpringFormEngineConfiguration.class,
		RibbonConfig.class
		})
@SpringBootApplication(scanBasePackages = "com.sq.universe",
		exclude = {
				SecurityAutoConfiguration.class,
				SecurityFilterAutoConfiguration.class,
				FlowableUiSecurityAutoConfiguration.class,
		FlowableSecurityAutoConfiguration.class,
		OAuth2ClientAutoConfiguration.class})

//@SpringBootApplication(exclude={SecurityAutoConfiguration.class, OAuth2AutoConfiguration.class,SecurityFilterAutoConfiguration.class,ManagementWebSecurityAutoConfiguration.class})
@MapperScan("com.sq.universe.*.dao")
@EnableDiscoveryClient
@EnableFeignClients(basePackages  = "com.sq.universe")
@EnableOpenApi
public class FlowableApplication {

	public static void main(String[] args) {
		SpringApplication.run(FlowableApplication.class, args);
	}

}
